package com.ldx.springaopdemo.controller;

import com.ldx.springaopdemo.aspect.MyAspect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {
    @RequestMapping("/t1")
    @MyAspect
    public String t1(){
        log.info("t1开始执行");
        return "t1";
    }
    @RequestMapping("/t2")
    public String t2(){
        log.info("t2开始执行");
        int a = 1/0;
        return "t2";
    }
}
